package org.example.mytest.control;

import org.example.mytest.entity.Myclass;
import org.example.mytest.entity.Score;
import org.example.mytest.mapper.MyclassMapper;
import org.example.mytest.mapper.ScoreMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/score")
public class ScoreControler
{
    @Autowired
    private ScoreMapper scoreMapper;
    @GetMapping("/score/query0")
    public List query2() {
        List<Score> list =  scoreMapper.selectList(null);
        return list;
    }
    @GetMapping("/selectById/{scoreid}")
    public Score selectById(@PathVariable("scoreid")Integer scoreid)
    {
        return scoreMapper.findbyidscore(scoreid);
    }

    @GetMapping("/findById/{scoreid}")
    public List<Score> findscoreById(@PathVariable("scoreid")Integer scoreId)
    {
        return scoreMapper.findscoreby(scoreId);
    }



}
